home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD023b.dsk
/
FACTORS.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
741b
|
20 lines
5 HOME : CLEAR
10 INPUT "# TO BE FACTORED=";A
15 PRINT : PRINT "INTEGRAL FACTORS OF "A" ARE": PRINT
16 CX = INT( SQR(A)) +1
20 FOR X = 2 TO CX
22 ZZ = PEEK(49200)
25 Z = A/X
30 IF X = CX AND C = 0 THEN VTAB 3: PRINT "(";A;" IS A PRIME NUMBER) "
35 IF NOT (Z = INT(Z)) THEN 50
40 C = C +1: REM PRIME TESTER
45 IF NOT (X = A) THEN POKE 36,10 - LEN( STR$(Z)): PRINT Z;: POKE 36,12: PRINT "X";: POKE 36,14 + LEN( STR$( INT( SQR(A)))) - LEN( STR$(X)): PRINT X
50 NEXT X
55 PRINT : PRINT
60 PRINT "ANOTHER? (Y/N)"
65 GET Y$: IF NOT (Y$ = "Y" OR Y$ = "N") THEN 60
70 IF Y$ = "Y" THEN 5
75 PRINT : PRINT CHR$(4)"RUNMENU"
80 REM FRED HALL
83 REM 16 SUNRISE TERRACE
85 REM PLAISTOW NH 03865